<?php
/**
 * 360随机图片
 */
error_reporting(0);
$cid = ver('cid');

function image($cid) {

	$i = rand(0, 100);
	$limit =rand(0, 100);
	$url = "http://wallpaper.apc.360.cn/index.php?%20c=WallPaper&a=getAppsByCategory&cid={$cid}&start={$i}&count={$limit}&from=360chrome";
	$content = file_get_contents($url);
	$Json = json_decode($content, 1);
    $Num = count($Json['data']);
    $Arrnum = rand(0, $Num);
    return $Json['data'][$Arrnum]['url'];
  
}

$img = image($cid);
header("Location:{$img}");
